﻿using System;
using StructureMap.AutoMocking;
using Moq;

public class MyClass
{
    public class MyClass2
    {
         
    }
    
}

namespace AutoWrockTestable
{
    public class Testable<TClassUnderTest> where TClassUnderTest : class
    {
        protected MoqAutoMocker<TClassUnderTest> AutoMocker = new MoqAutoMocker<TClassUnderTest>();

        public Testable()
        {

        }

        public Testable(Action<Testable<TClassUnderTest>> setup)
        {
            setup(this);
        }

        public Mock<TDependencyToMock> Mock<TDependencyToMock>() where TDependencyToMock : class
        {
            var a = AutoMocker.Get<TDependencyToMock>();
            return Moq.Mock.Get(a);
        }

        public AutoMockedContainer AutoMockContainer
        {
            get
            {
                return AutoMocker.Container;
            }
        }

        public void Inject<T>(T type)
        {
            AutoMocker.Inject(type);
        }

        public void InjectArray<T>(T[] types)
        {
            AutoMocker.InjectArray(types);
        }

        public TClassUnderTest ClassUnderTest
        {
            get { return AutoMocker.ClassUnderTest; }
        }
    }
}